package com.webbei.basic.init;

import java.util.List;

import javax.servlet.ServletContext;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.webbei.basic.service.InitProductSer;
import com.webbei.basic.service.impl.InitProductSerImpl;

public class InitProduct{

	private InitProductSer ps;
	private static WebApplicationContext springContext;
    public static ServletContext _servletContext;
    private static InitProduct _instance;
    public static List list;


    public static InitProduct getInstance()  {
       springContext = WebApplicationContextUtils.getWebApplicationContext(_servletContext);
       if(null == _instance) _instance = (InitProduct)springContext.getBean("initProduct");
       return _instance;
    }

	public void setPs(InitProductSerImpl ps) {
		this.ps = ps;
	}

	public void init(){
		list = ps.getproducts();
	}


}
